import * as types from '../constants/actionTypes';
import initialState from '../../reducers/initialState';

export default function(state = initialState.global, action) {
	switch (action.type) {
		case types.INITIALIZED:
			return Object.assign({},state,{initialized: true, welcomedone: action.welcomedone});
		case types.WELCOME_DONE:
			return Object.assign({},state,{welcomedone: true});
		case types.LOGIN_REQUIRED:
			return Object.assign({},state,{loginRequired: true});
		case types.RELOAD_MAIN:
			return Object.assign({},state,{reloadmain: action.reloadmain});
		case types.IS_ENTER_MESSAGE:
			return Object.assign({},state,{is_enter_message: action.is_enter_message});
		default:
			return state;
	}
}
